package com.yingxin.yxerp.module.print.service.impl;


import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yingxin.yxerp.module.print.constant.PrintStatusConst;
import com.yingxin.yxerp.module.print.entity.PrintBusinessStat;
import com.yingxin.yxerp.module.print.mapper.PrintBusinessStatMapper;
import com.yingxin.yxerp.module.print.service.IPrintBusinessStatService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 打印biz统计 服务实现类
 * </p>
 *
 * @author fanchao
 * @since 2022-02-19
 */
@Service
public class PrintBusinessStatServiceImpl extends ServiceImpl<PrintBusinessStatMapper, PrintBusinessStat> implements IPrintBusinessStatService {

    @Override
    public void updatePrintStatusByApproved(String bizId) {
        UpdateWrapper<PrintBusinessStat> uw = new UpdateWrapper<>();
        uw.lambda().set(PrintBusinessStat::getPrintStatus, PrintStatusConst.PRINTABLE);
        uw.lambda().eq(PrintBusinessStat::getBusinessId, bizId);
        uw.lambda().eq(PrintBusinessStat::getPrintStatus, PrintStatusConst.AFTER_APPROVED);
        update(uw);
    }

}
